package com.woniuxy.oldmanapi.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.oldmanapi.mapper.OlderMapper;
import com.woniuxy.oldmanapi.yvo.OlderAndBedVo;
import com.woniuxy.oldmanapi.yvo.OutApplicationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderService {
    @Autowired
    OlderMapper olderMapper;

    /**
     * 此方法为初始化外出申请表页面数据 分页展示
     *
     * @param name 搜索框条件
     * @param now  分页 页数
     * @param size 分页 条数
     * @return
     */
    public PageInfo<OlderAndBedVo> initSelectOlderAndBedByCons(String name, int now, int size) {
        PageHelper.startPage(now, size);
        List<OlderAndBedVo> arr = olderMapper.initSelectOlderAndBedByCons(name);
        return new PageInfo<>(arr);
    }
}
